package com
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	import com.UI.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	import flash.utils.*;
	import flash.utils.Timer;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	
	public class CharInfo
	{
		public static var accountId:uint;
		public static var charId:uint;
		public static var m_nRace:uint;
		public static var m_nGender:uint;
		public static var charName:String = "";
		public static var ingot:uint;
		public static var money:uint;
		public static var honour:uint = 0;
		public static var wood:uint = 0;
		public static var food:uint = 0;
		public static var m_nLevel:uint;
		public static var value:uint;
		public static var headId:uint;
		public static var m_nImageId:uint;
		public static var mapId:uint;
		public static var mapLineId:uint;
		public static var mapType:uint;
		public static var mapOwnerId:uint;
		public static var mapX:uint;
		public static var mapY:uint;
		//public static var mapBaseX:uint = 0;
		//public static var mapBaseY:uint = 0;
		
		//
		public static var stamina:uint;
		public static var staminaMax:uint;
		public static var staminaUpdateTime:uint;
		public static var exp:uint;
		public static var expMax:uint;
		public static var hp:uint;
		public static var hpMax:uint;
		public static var m_nNextPointHP:uint;
		public static var m_nNextPointMoneyHP:uint;
		public static var ap:uint;
		public static var m_nNextPointAP:uint;
		public static var m_nNextPointMoneyAP:uint;
		public static var dp:uint;
		public static var m_nNextPointDP:uint;
		public static var m_nNextPointMoneyDP:uint;
		public static var sp:uint;
		public static var m_nNextPointSP:uint;
		public static var m_nNextPointMoneySP:uint;
		
		public static var pointHP:uint;
		public static var pointAP:uint;
		public static var pointDP:uint;
		public static var pointSP:uint;
		public static var points:uint;
		
		public static var resistHY:uint;
		public static var resistZS:uint;
		public static var resistJD:uint;
		
		public static var m_nPropBJ:uint;
		public static var m_nPropSB:uint;
		public static var m_nPropFJ:uint;
		public static var m_nPropLJ:uint;
		public static var m_nBattlePartnerType:uint;
		//
		/*public static var m_strRealName:String = "陶陶陶";
		public static var m_nArchiveGender:uint = 0;
		public static var m_strBirthday:String = "28";
		public static var m_nHeight:uint = 0;
		public static var m_strIncome:String = "保密";
		public static var m_strCareer:String = "游戏开发";
		public static var m_strNativeProvince:String = "湖南";
		public static var m_strNativeCity:String = "长沙";
		public static var m_strNativeAdded:String = "";
		public static var m_strAddressProvince:String = "广东";
		public static var m_strAddressCity:String = "深圳";
		public static var m_strAddressAdded:String = "";
		public static var m_strSelfIntroduction:String = "看准方向,然后付出一切.";
		public static var m_strFigureURL:String = "";*/
		//
		
		public static var m_mapListTrends:Array = [];
		m_mapListTrends[Const.TREND_TYPE_NORMAL] = [];
		m_mapListTrends[Const.TREND_TYPE_HOME] = [];
		m_mapListTrends[Const.TREND_TYPE_SLAVE] = [];
		m_mapListTrends[Const.TREND_TYPE_LOVER] = [];
		
		public static var m_arItemPage:Array = [];
		m_arItemPage[0] = [];
		m_arItemPage[1] = [];
		m_arItemPage[2] = [];
		m_arItemPage[3] = [];
		m_arItemPage[4] = [];
		m_arItemPage[5] = [];
		
		public static var m_arStallItems:Array = [];
		
		public static var m_arSkills:Array = [];
		public static var m_arDefaultSkills:Array = [];
		public static var m_arPets:Array = [];
		public static var m_nPetJoinBattleIndex:int = 0;
		public static var m_arFriends:Array = [];
		public static var m_arFriendsFavorite:Array = [];
		public static var m_arFriendsBoring:Array = [];
		public static var m_arFriendsTmp:Array = [];

		public static var objSelf:ObjectCharPlayer = null;
		
		public static var m_nBattleMode:int;//战斗模式0,自动,1手动
		public static var m_arAutoBattleSkills:Array = [];
		public static var m_arAutoBattleSkillsSoul:Array = [];
		public static var objLover:Object = {};
		public static var m_nIdMainCompleted:int = 0;
		public static var m_arTasks:Array = [];
		
		public static var m_nSlaveMasterCharId:int = 0;
		public static var m_nSlaveMasterCharName:String = '';
		public static var m_nSlaveMasterRace:int = 0;
		public static var m_nSlaveMasterGender:int = 0;
		public static var m_nSlaveMasterLevel:int = 0;
		public static var m_nSlaveJoinBattleIndex:int = 0;
		public static var m_arSlaves:Array = [];
		public static var m_arSlavesCatch:Array = [];
		public static var m_stTitleCurrent:Object = {};
		public static var m_arTitles:Array = [];
		public static var m_arBuffs:Array = [];
		public static var m_objFaction:Object = {};
		public static var m_nUseTeamSoul:int = 0;
		public static var m_arTeamSoulMembers:Array = [];
		public static var m_arJoinTeamSoul:Array = [];
		public function CharInfo()
		{
		}
		public static function clear():void
		{
			mapId = 0;
			mapLineId = 0;
		}
		
		
		
		public static function getSkillObjectBySkillCSVId(arSkills:Array,csv_id:int):Object
		{
			for each(var item:Object in arSkills)
			{
				if(item.csv_id == csv_id)
					return item;
			}
			return null;
		}
		
		public static function getSkillObjectBySkillCSVIdCurrentPet(csv_id:int):Object
		{
			var array:Array = null
			if(CharInfo.objLover.m_bLoverJoinBattle)
			{
				array = CharInfo.objLover.m_arSkills;
			}
			else if(CharInfo.m_nPetJoinBattleIndex >= 0 && CharInfo.m_nPetJoinBattleIndex < CharInfo.m_arPets.length)
			{
				array = CharInfo.m_arPets[CharInfo.m_nPetJoinBattleIndex].m_arSkills;
			}
			if(array != null)
			{
				for each(var item:Object in array)
				{
					if(item.csv_id == csv_id)
						return item;
				}
			}
			return null;
		}
		
	}
}